<template>
	<view class="content">
		<view class="title">{{news1}}</view>
		<view class="art-content">
			<rich-text class="richText" :nodes="strings"></rich-text>
		</view>
	</view>
</template>

<script setup>
	import {onLoad} from '@dcloudio/uni-app'
	import { string } from 'prop-types';
	import { ref } from 'vue';
	
	const news1 =ref()
	const strings = ref()
	
	onLoad((e)=>{
		uni.showLoading({
			title:"加载中..."
		})
		uni.request({
			url:'https://unidemo.dcloud.net.cn/api/news/36kr/'+e.newsid,
			method:'GET',
			data:{},
			success:res => {
				news1.value=res.data.title;
				strings.value=res.data.content;
				uni.hideLoading()	
			},
			fail: () => {},
			complete:()=>{}
		})
	})
</script>

<style lang="scss" scoped>
.content{
	padding: 10rpx 2%;
	width: 96%;
	flex-wrap: wrap;
	.title{
		line-height: 2em;
		font-weight: 700;
		font-size: 38rpx;
	}
	.art-content{
		line-height: 2em;
	}
}	       
</style>
